/*
 * @Descripttion: 控制台输出颜色,挂载在app上
 * @version: 
 * @Author: turingchang
 * @Date: 2020-08-26 12:39:17
 * @LastEditors: turingchang
 * @LastEditTime: 2020-08-26 13:47:16
 */


module.exports = (options, app) => {
    return async function load(ctx, next) {
        await loadConsoleColor(ctx,next);
        await next(options);
    };

    async function loadConsoleColor(ctx, next){
        //自定义控制台输出颜色
        ctx.app.colors.setTheme({
            success:'green',
            silly: 'rainbow',
            input: 'grey',
            verbose: 'cyan',
            prompt: 'white',
            info: 'green',
            data: 'white',
            help: 'cyan',
            warn: 'yellow',
            debug: 'blue',
            error: 'red'
          });
    }


}